-include_lib("ect/include/ect.hrl").


-import_class(alpha).
-import_class(beta).
-import_class(gamma).
-import_class(delta).
-import_class(epsilon).
-import_class(zeta).

%-import_class(rw10).
%-import_class(rw20).
%-import_class(rw30).
%-import_class(rw40).
%-import_class(rw50).
%-import_class(rw60).
%-import_class(rw70).
%-import_class(rw80).
%-import_class(rw90).
%-import_class(rw100).



-define(CLASSES, [alpha, beta, gamma, delta, epsilon, zeta]).
-define(CLASSES2, [rw10, rw20, rw30, rw40, rw50, rw60, rw70, rw80, rw90, rw100]).
-define(CATEGORIES, [calltest, readtest, writetest]).
%-define(CATEGORIES, [calltest, readtest, writetest, {readtest2, ?CLASSES2}, {writetest2, ?CLASSES2}]).

-define(OPS100k, 10).

-include("../measure.hrl").



readtest(Obj) ->
    #alpha{field1 = A} = Obj,
    A.

writetest(Obj1) ->
    Obj1#alpha{field1 = 1}.


readtest2(Obj) ->
%    #rw10{f2 = A} = Obj,
%   A.
    throw(not_impl).

writetest2(Obj1) ->
%    Obj1#rw10{f2 = 1},
    throw(not_impl).


calltest(Obj) ->
    {Obj}:method1().

init_object(alpha) -> #alpha{field1 = 1, field2 = 2, field3 = 3, field4 = 4};
init_object(beta) -> #beta{field1 = 1, field2 = 2, field3 = 3, field4 = 4};
init_object(gamma) -> #gamma{field1 = 1, field2 = 2, field3 = 3, field4 = 4};
init_object(delta) -> #delta{field1 = 1, field2 = 2, field3 = 3, field4 = 4};
init_object(epsilon) -> #epsilon{field1 = 1, field2 = 2, field3 = 3, field4 = 4};
init_object(zeta) -> #zeta{field1 = 1, field2 = 2, field3 = 3, field4 = 4}.

%init_object(rw10) -> #rw10{f1 = 42};
%init_object(rw20) -> #rw20{};
%init_object(rw30) -> #rw30{};
%init_object(rw40) -> #rw40{};
%init_object(rw50) -> #rw50{};
%init_object(rw60) -> #rw60{};
%init_object(rw70) -> #rw70{};
%init_object(rw80) -> #rw80{};
%init_object(rw90) -> #rw90{};
%init_object(rw100) -> #rw100{}.

dispose_object(_) ->
    ok.